<?php

function cli_exception_handler($exception) {
	if($exception instanceof Exception) {
		// creating CommandLineException object manually and calling handling method
		$commandLineException = new CommandLineException($exception->getMessage());
		$commandLineException->handleException($exception);
	}
}

set_exception_handler('cli_exception_handler');
